//
//  CLNetWorker.h
//  Charles
//
//  Created by Charles on 2018/6/6.
//  Copyright © 2018年 charles. All rights reserved.
//

#import <Foundation/Foundation.h>

@class CLBaseRequest;
/**
 真正发起请求的类。负责发起请求，结束请求，并持有一个字典来存储正在执行的请求。
 */
@interface CLNetWorkManager : NSObject

- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

// Network单例
+ (CLNetWorkManager *)sharedManager;

// 添加并发起一个请求
- (void)addRequest:(CLBaseRequest *)request;

// 取消前面添加的一个请求
- (void)cancelRequest:(CLBaseRequest *)request;

// 取消前面添加的所有的请求
- (void)cancelAllRequests;

- (NSString *)buildRequestUrl:(CLBaseRequest *)request;

@end
